import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
    {
    title: '资产名称',
    dataIndex: 'assetName'
   },
   {
    title: '资产编码',
    dataIndex: 'assetCoding'
   },
   {
    title: '所属人id',
    dataIndex: 'ownerId'
   },
   {
    title: '所属人姓名',
    dataIndex: 'owner'
   },
   {
    title: '使用人id',
    dataIndex: 'userId'
   },
   {
    title: '使用人姓名',
    dataIndex: 'userer'
   },
   {
    title: '资产状态',
    dataIndex: 'status'
   },
   {
    title: '主表id',
    dataIndex: 'applyId'
   },
   {
    title: '部门id',
    dataIndex: 'deptId'
   },
   {
    title: '部门名称',
    dataIndex: 'deptName'
   },
   {
    title: '盘点状态,1 已盘',
    dataIndex: 'inventoryStatus'
   },
   {
    title: '入账日期',
    dataIndex: 'useTime'
   },
   {
    title: 'startTime',
    dataIndex: 'startTime'
   },
   {
    title: '资产规格',
    dataIndex: 'spec'
   },
   {
    title: '待盘数量',
    dataIndex: 'notInventoryQuantity'
   },
   {
    title: '已盘数',
    dataIndex: 'inventoryQuantity'
   },
   {
    title: '资产数',
    dataIndex: 'assetsNum'
   },
   {
    title: '备注',
    dataIndex: 'msgDesc'
   },
   {
    title: '单据唯一值',
    dataIndex: 'uniqueId'
   },
   {
    title: '类别',
    dataIndex: 'category'
   },
   {
    title: 'preliminaryStatus',
    dataIndex: 'preliminaryStatus'
   },
];

export const searchFormSchema: FormSchema[] = [
 {
    label: '资产名称',
    field: 'assetName',
    component: 'Input'
  },
 {
    label: '资产编码',
    field: 'assetCoding',
    component: 'Input'
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  {label: '', field: 'id', component: 'Input', show: false},
  {
    label: '资产名称',
    field: 'assetName',
    component: 'Input',
  },
  {
    label: '资产编码',
    field: 'assetCoding',
    component: 'Input',
  },
  {
    label: '所属人id',
    field: 'ownerId',
    component: 'Input',
  },
  {
    label: '所属人姓名',
    field: 'owner',
    component: 'Input',
  },
  {
    label: '使用人id',
    field: 'userId',
    component: 'InputNumber',
  },
  {
    label: '使用人姓名',
    field: 'userer',
    component: 'Input',
  },
  {
    label: '资产状态',
    field: 'status',
    component: 'Input',
  },
  {
    label: '主表id',
    field: 'applyId',
    component: 'InputNumber',
  },
  {
    label: '部门id',
    field: 'deptId',
    component: 'InputNumber',
  },
  {
    label: '部门名称',
    field: 'deptName',
    component: 'Input',
  },
  {
    label: '盘点状态,1 已盘',
    field: 'inventoryStatus',
    component: 'Input',
  },
  {
    label: '入账日期',
    field: 'useTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD hh:mm:ss',
    },
  },
  {
    label: 'startTime',
    field: 'startTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD hh:mm:ss',
    },
  },
  {
    label: '资产规格',
    field: 'spec',
    component: 'Input',
  },
  {
    label: '待盘数量',
    field: 'notInventoryQuantity',
    component: 'InputNumber',
  },
  {
    label: '已盘数',
    field: 'inventoryQuantity',
    component: 'InputNumber',
  },
  {
    label: '资产数',
    field: 'assetsNum',
    component: 'InputNumber',
  },
  {
    label: '备注',
    field: 'msgDesc',
    component: 'Input',
  },
  {
    label: '单据唯一值',
    field: 'uniqueId',
    component: 'Input',
  },
  {
    label: '类别',
    field: 'category',
    component: 'Input',
  },
  {
    label: 'preliminaryStatus',
    field: 'preliminaryStatus',
    component: 'InputNumber',
  },
];
